package cn.com.nes.site.service.system.user.impl;

import cn.com.nes.mybatis.agent.system.entity.TUser;
import cn.com.nes.mybatis.agent.system.mapper.TUserMapper;
import cn.com.nes.site.service.system.user.SystemUserAccountService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 系统用户账号服务
 *
 * @Author: ShenWei
 * @Date: 2024/06/26/16:49
 */
@Service
public class SystemUserAccountServiceImpl implements SystemUserAccountService {

    @Resource
    private TUserMapper tUserMapper;

    @Override
    public void bindEasyRepairAccount(String uuid, String easyRepairUserId) {
        TUser user = new TUser();
        user.setUuid(uuid);
        user.setEasyRepairUserId(StrUtil.isBlank(easyRepairUserId) ? null : Long.valueOf(easyRepairUserId));
        tUserMapper.bindEasyRepairAccount(user);
    }

    @Override
    public void bindCallCenterAccount(String uuid, String callCenterUserId) {
        TUser user = new TUser();
        user.setUuid(uuid);
        user.setCallCenterUserId(StrUtil.isBlank(callCenterUserId) ? null : Long.valueOf(callCenterUserId));
        tUserMapper.bindCallCenterAccount(user);
    }
}
